package com.mjk.common.web.getway.conf;


import com.mjk.common.tools.gson.adapter.BeeGsonAdapterType;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 修改springmvc json为 GSON
 * @author Administrator
 *
 */
//@Configuration
public class JacksonConf implements WebMvcConfigurer {
	
	 @Bean
	 public GsonHttpMessageConverter gsonHttpMessageConverter() {

         return new CustomGsonHttpMessageConverter();
	 }
	
	 public static class CustomGsonHttpMessageConverter extends GsonHttpMessageConverter{
		 public CustomGsonHttpMessageConverter(){
			//更换Gson转换器
				super.setGson(BeeGsonAdapterType.getGson(false));
		 }
	 }
}
